package com.skj.client;

import com.google.gwt.core.client.* ;
import com.google.gwt.dom.client.* ;
import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.* ;
import com.google.gwt.event.shared.* ;
import com.google.gwt.user.client.* ;
import com.google.gwt.user.client.ui.* ;
import com.google.gwt.json.client.* ;

public class Editor implements EntryPoint
{
	private Document 	document 		;
	private BodyElement body 			;
	private Element 	editor 			;
	
	private int maxX ;
	private int maxY ;
	
	// Engine
	private Engine engine ;	
	
	@Override
	public void onModuleLoad()
	{
		document 	= Document.get() ;
		body 		= document.getBody() ;
		editor 		= body.getFirstChildElement().getNextSiblingElement() ;
		
		maxX = document.getClientWidth() ;
		maxY = document.getClientHeight() ;
		
		engine = new Engine(maxX, maxY) ;
		engine.getJSONFromServer("http://www.skjworld.com/editor/json.js") ;
		
		// System.out.println("") ;
		
		//engine.getJSONPFromServer("http://www.skjworld.com/editor/skj.json") ;
	}
}




/*
// Fun2Hit JSON - Slide 1
engine.CREATE_LAYER("SLIDE1_BACK", "FILLED_RECTANGLE"		, 1, 0, 0,  0,  0, 240,320, null, null, null) ;
engine.CREATE_LAYER("SLIDE1_SKJLOGO", "IMAGE"				, 1, 0, 0, 21, 96, 100, 59, "/res/logo.png", null, null) ;

double [] SLIDE1_LOADING_BAR_RECT_STYLE_DATA = {100,210,255} ;
engine.CREATE_LAYER("SLIDE1_LOADING_BAR_RECT", "RECTANGLE"	, 1, 0, 0, 24,187, 193,  9, null, SLIDE1_LOADING_BAR_RECT_STYLE_DATA, null) ;
engine.CREATE_LAYER("SLIDE1_LOADING_BAR_FILL_RECT", "FILLED_RECTANGLE",1,0,0,24,187,9,9, null, SLIDE1_LOADING_BAR_RECT_STYLE_DATA, null) ;

String [] layers = {"SLIDE1_BACK","SLIDE1_SKJLOGO","SLIDE1_LOADING_BAR_RECT","SLIDE1_LOADING_BAR_FILL_RECT"} ;
engine.CREATE_SLIDE("SLIDE1", 1, 0, 0, 0, 0, 400, 400, 100, layers) ;
*/